package com.itheima.service;

import com.itheima.dao.PersonnelDao;
import com.itheima.entity.Result;
import com.itheima.pojo.Personnel;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service(interfaceClass = PersonnelService.class)
public class PersonnelServiceImpl implements PersonnelService {

    @Autowired
    private PersonnelDao personnelDao;

    @Override
    public List<Personnel> findAll() {
        return personnelDao.findAll();
    }

    @Override
    public Result add(Personnel personnel) {
        try{
            personnelDao.add(personnel);
            return new Result(true,"添加企业人员成功");
        }catch (Exception e){
            return new Result(false,"添加企业人员失败");
        }

    }
}
